MessageArguments is the base class for arguments passed in messages. More...
#include <kanzi/core.ui/message/message_arguments.hpp>
Classes | |
struct | ArgumentEntry |
Linked list entry containing arguments type and value. More... | |
Public Member Functions | |
bool | getAbstractArgument (AbstractPropertyType argumentType, Variant &variant) const |
Returns the value of an argument using AbstractPropertyType. | |
template<typename TDataType > | |
TDataType | getArgument (const PropertyType< TDataType > &argumentType) const |
Returns the value of an argument. | |
detail::MessageDispatcher * | getDispatcher () const |
Returns the message dispatcher that dispatches a message. | |
template<typename TDataType > | |
optional< TDataType > | getOptionalArgument (const PropertyType< TDataType > &argumentType) const |
Returns the value of an argument. | |
shared_ptr< Node > | getSource () const |
Returns the source node for a message. | |
TimePoint | getTimestamp () const |
Returns the timestamp of a message. | |
AbstractMessageType | getType () const |
Returns the message type of these message arguments as an AbstractMessageType instance. | |
bool | isFrom (const Node &source) const |
Returns whether a node is the source node of a message. | |
bool | isHandled () const |
Returns whether the message is handled. | |
bool | isValid () const |
Returns whether a message is valid. | |
MessageArguments ()=default | |
Constructor. | |
MessageArguments (const MessageArguments &)=delete | |
Deleted copy. | |
MessageArguments & | operator= (const MessageArguments &)=delete |
Deleted assignment. | |
void | setAbstractArgument (AbstractPropertyType argumentType, const Variant &variant) |
Sets the value of an argument using AbstractPropertyType. | |
template<typename TDataType > | |
void | setArgument (const PropertyType< TDataType > &argumentType, typename PropertyType< TDataType >::DataType value) |
Sets the value of an argument. | |
void | setDispatcher (detail::MessageDispatcher *dispatcher) |
Sets a dispatcher for a message. | |
void | setHandled (bool handled) |
Sets the handling status for a message. | |
void | setSource (Node *source) |
Sets the source node that dispatches a message. | |
void | setTimestamp (TimePoint timestamp) |
Sets the timestamp of a message. | |
void | setType (AbstractMessageType type) |
Sets the type of a message. | |
void | setValid (bool valid) |
Sets the validity of a message. | |
~MessageArguments () | |
Destructor. | |
Static Public Member Functions | |
static size_t | getArgumentAllocatorPoolSize () |
Gets the current size of memory pool of argument entries. | |
static const Metaclass * | getStaticMetaclass () |
Initializes and returns static metadata of base MessageArguments class. | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Initializes and returns the Kanzi Studio editor information. | |
MessageArguments is the base class for arguments passed in messages.
An instance of MessageArguments together with an instance of MessageType forms a Kanzi message. In Kanzi when you dispatch a message, you dispatch a message of certain type and arguments.
While MessageArguments is a base class where you can inherit your own specialized arguments, MessageType is a templated class which takes message argument type as its template parameter. In practice this means that each MessageType is linked with a certain MessageArguments type. You can derive your own arguments class or use the MessageArguments base class. Note that MessageArguments as a base class carries only the basic message information, such as the timestamp and source of the message. To dispatch any other data with your messages, inherit your own message arguments class.
You can link a message type with only one type of message arguments, but you can use a certain type of message arguments with multiple message types. See MessageType.
|
explicitdefault |
Constructor.
kanzi::MessageArguments::~MessageArguments | ( | ) |
Destructor.
|
delete |
Deleted copy.
|
delete |
Deleted assignment.
|
inline |
Returns the value of an argument.
argumentType | The PropertyType argument whose value to fetch. |
|
inline |
Returns the value of an argument.
argumentType | The PropertyType argument whose value to fetch. |
bool kanzi::MessageArguments::getAbstractArgument | ( | AbstractPropertyType | argumentType, |
Variant & | variant ) const |
Returns the value of an argument using AbstractPropertyType.
argumentType | The AbstractPropertyType argument whose value to get. |
variant | The variant where to store the message argument value. |
|
inline |
Sets the value of an argument.
argumentType | The PropertyType argument whose value to set. |
value | The value to set for the argument. |
void kanzi::MessageArguments::setAbstractArgument | ( | AbstractPropertyType | argumentType, |
const Variant & | variant ) |
Sets the value of an argument using AbstractPropertyType.
argumentType | The AbstractPropertyType argument whose value to set. |
variant | The variant whose value to store to the message argument value. |
Returns whether a node is the source node of a message.
source | The node to check. |
shared_ptr< Node > kanzi::MessageArguments::getSource | ( | ) | const |
Returns the source node for a message.
Sets the handling status for a message.
handled | The new handling status. |
|
inline |
Returns whether the message is handled.
|
inline |
Returns the timestamp of a message.
|
inline |
Returns the message dispatcher that dispatches a message.
|
inline |
Returns the message type of these message arguments as an AbstractMessageType instance.
Sets the source node that dispatches a message.
source | The source of the message. |
Sets the timestamp of a message.
timestamp | The timestamp of the message. |
Sets the validity of a message.
valid | The validity of the message. |
|
inline |
Returns whether a message is valid.
|
inline |
Sets a dispatcher for a message.
dispatcher | Message dispatcher that dispatches the message. |
|
inline |
Sets the type of a message.
type | The type of the message. |
|
static |
Gets the current size of memory pool of argument entries.
Initializes and returns static metadata of base MessageArguments class.
|
inlinestatic |
Initializes and returns the Kanzi Studio editor information.